New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix getElementBoundingBox() OOP version returning 6 numbers instead of a 2 vectors #305
Fix getElementBoundingBox() OOP version returning 6 numbers instead of a 2 vectors #305
Conversation
Also, please see the header file, I left a comment there, please help me out with that :) |
@@ -42,6 +42,7 @@ class CLuaElementDefs : public CLuaDefs | |||
LUA_DECLARE(GetElementDimension); | |||
LUA_DECLARE(GetElementZoneName); | |||
LUA_DECLARE(GetElementBoundingBox); | |||
LUA_DECLARE_OOP(GetElementBoundingBox);// Probably wrong, tell me how to declare the OOP version of this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ok. You should remove LUA_DECLARE(GetElementBoundingBox)
as LUA_DECLARE_OOP(GetElementBoundingBox)
automatically does both. This duplicate declaration causes a compile error C2535.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll remove it.
@@ -42,7 +42,6 @@ class CLuaElementDefs : public CLuaDefs | |||
LUA_DECLARE(GetElementDimension); | |||
LUA_DECLARE(GetElementZoneName); | |||
LUA_DECLARE(GetElementBoundingBox); | |||
LUA_DECLARE_OOP(GetElementBoundingBox);// Probably wrong, tell me how to declare the OOP version of this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you did it the other way around :)
Remove LUA_DECLARE(GetElementBoundingBox)
, keep LUA_DECLARE_OOP(GetElementBoundingBox)
.
For your reference, this is how they work:
#define LUA_DECLARE(x) static int x ( lua_State * luaVM );
#define LUA_DECLARE_OOP(x) LUA_DECLARE(x) LUA_DECLARE(OOP_##x)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, alright, thanks :)
I think the 510990e (min_mta_version tag in meta) solution is more elegant than a bool argument for legacy style |
Reminder for committer: |
Thank you! |
Small'n'Easy to test.
Fixes the OOP version of getElementBoudingBox.